home *** CD-ROM | disk | FTP | other *** search
/ C/C++ Users Group Library 1996 July / C-C++ Users Group Library July 1996.iso / listings / v_12_08 / plauger / isxchar.c < prev    next >
C/C++ Source or Header  |  1994-06-09  |  372b  |  18 lines

  1. -------------------------- Listing 2:  char extractor ---------
  2.  
  3. // isxchar -- istream::operator>>(char&)
  4. #include <istream>
  5.  
  6. istream& istream::operator>>(char& c)
  7.     {    // extract an arbitrary character
  8.     int ch;
  9.     _TRY_IO_BEGIN
  10.     if (!ipfx() || (ch = rdbuf()->sbumpc()) == EOF)
  11.         setstate(failbit);
  12.     else
  13.         c = ch;
  14.     isfx();
  15.     _CATCH_IO_END
  16.     return (*this);
  17.     }
  18.